<?php namespace Common\Model;
use Hdphp\Model\Model;
//货品列表模型
class Goodslists extends Model{
	protected $table='goodslist';
	//	自动验证
	protected $validate=array(
		array('combline','reuqired','组合id不能为空',3,3),
		array('number','reuqired','货号不能为空',3,3),
		array('inventory','reuqired','库存不能为空',3,3),);
	
//	添加
public function store($data){
	if(!$this->create()) return false;
	return $this->add($data);
}
//	删除
public function del($glid){
	return $this->delete($glid);
}
	
//	修改
public function edit($glid,$data){
//	$data=$_POST;
//	$data['combine']=implode(',', $data['combine']);
	
	if(!$this->create( )) return false;

	return $this->where('glid',$glid)->save($data);
}
	
	
}
